<%--
  Created by IntelliJ IDEA.
  User: kagura
  Date: 2020/12/20
  Time: 5:33 下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <div id="editordertb" style="padding: 2px 5px;">
        <div id="editdivOrderInfo">
            <div style="padding: 3px;">
                客户名称&nbsp;
                <input style="width: 115px;" id="edit_uid" class="easyui-textbox" name="edit_uid"
                        readonly="readonly" value="${requestScope.oi.ui.userName }"/>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                订单金额&nbsp;
                <input style="width: 115px;" type="text" id="edit_orderprice" class="easyui-textbox"
                       name="edit_orderprice" readonly="readonly" value="${requestScope.oi.orderprice }"/>&nbsp;&nbsp;
            </div>
            <div style="padding: 3px;">
                订单日期&nbsp;
                <input style="width: 115px;" type="text" id="edit_ordertime" class="easyui-datebox"
                       name="edit_ordertime" readonly="readonly" value="${requestScope.oi.ordertime }"/>&nbsp;&nbsp;
                &nbsp;&nbsp;订单状态&nbsp;
                <input style="width: 115px;" id="edit_status" class="easyui-textbox"
                       name="edit_status" readonly="readonly" value="${requestScope.oi.status }"/>
            </div>
        </div>
    </div>

    <!-- 定义table，用于创建EasyUI的datagrid组件 -->
    <table id="editodbox" class="easyui-datagrid"></table>

    <script type="text/javascript">
        var $editodbox = $('#editodbox');
        $(function () {
            $editodbox.datagrid({
                url: 'orderinfo/getOrderDetails?oid=${requestScope.oi.id}',
                rownumbers: true,
                singleSelect: false,
                fit: true,
                toolbar: '#editordertb',
                columns: [[{
                    field: 'pid',
                    title: '商品名称',
                    width: 300,
                    formatter: function (value, row, index) {
                        if (row.pi) {
                            return row.pi.name;
                        } else {
                            return value;
                        }
                    }
                }, {
                    field: 'price',
                    title: '单价',
                    width: 80
                }, {
                    field: 'num',
                    title: '数量',
                    width: 50
                }, {
                    field: 'totalPrice',
                    title: '小计',
                    width: 100
                }]]
            });
        });
    </script>
</body>
</html>
